import java.util.Scanner;

public class ScoreTest {
    public static void main(String[] args) {
        System.out.println("当前选手得分是:" + getAverageScore(6));
    }

    public static double getAverageScore(int number) {
        int[] scores = new int[number]; // scores = [0, 0, 0, 0, 0, 0]

        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < scores.length; i++) { // 修正错误：应该是 i++
            System.out.print("请您录入第" + (i + 1) + "个评委的分数:");
            int score = sc.nextInt();
            scores[i] = score;
        }

        int sum = 0; 
        int max = scores[0]; // 求最大值的
        int min = scores[0]; // 求最小值的
        for (int i = 0; i < scores.length; i++) { // 修正错误：应该是 i++
            int score = scores[i]; // 求和
            sum += score; // 求最大值
            if (score > max) {
                max = score;
            }
            if (score < min) {
                min = score;
            }
        }

        return 1.0 * (sum - min - max) / (number - 2);
    }
}
